<template>
	<view class="content">
		<view class="serve">
			<view v-if="isShowServeInfo" class="serve-info">
				<view class="header header-more">
					<view class="horizontal">
						<view class="line"></view>
						<view class="serve-info-title">联系方式</view>
					</view>
					<view class="serve-info-close" @click="isShowServeInfo = false">
						<image src="../../static/close_icon2.png" mode="widthFix"></image>
					</view>
				</view>
				<view class="dividing-line"></view>
				<view class="serve-info-list">
					<view class="serve-info-item">
						<view class="serve-info-item-image">
							<image src="../../static/wechat.png" mode="widthFix"></image>
						</view>
						<view class="serve-info-item-title">14865978215</view>
					</view>
					<view class="serve-info-item">
						<view class="serve-info-item-image">
							<image src="../../static/phone.png" mode="widthFix"></image>
						</view>
						<view class="serve-info-item-title">15948753264</view>
					</view>
					<view class="serve-info-item">
						<view class="serve-info-item-image">
							<image src="../../static/hotline.png" mode="widthFix"></image>
						</view>
						<view class="serve-info-item-title">400-6369-798</view>
					</view>
				</view>
			</view>
			<view v-else class="serve-image" @click="isShowServeInfo = true">
				<image src="../../static/serve.png" mode="widthFix"></image>
			</view>
		</view>

		<view v-if="isShowDialog" class="index_dialog">
			<image class="dialog_banner" src="../../static/dialog_banner.png" mode="widthFix"></image>
			<image class="dialog_close" src="../../static/close_icon.png" mode="widthFix" @click="isShowDialog = false">
			</image>
		</view>

		<swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000">
			<swiper-item v-for="item in bannerList">
				<image :src="item.thumb"></image>
			</swiper-item>
		</swiper>
		<view class="menu-list">
			<view class="menu-item" @click="openLouPanPage">
				<view class="menu-item-image">
					<image src="../../static/loupan_menu.png" mode="widthFix"></image>
				</view>
				<view class="menu-item-title"><text>热改楼盘</text></view>
			</view>
			<view class="menu-item" @click="openLinBaoPage">
				<view class="menu-item-image">
					<image src="../../static/linbao_menu.png" mode="widthFix"></image>
				</view>
				<view class="menu-item-title"><text>拎包入住</text></view>
			</view>
			<view class="menu-item" @click="openGongdiPage">
				<view class="menu-item-image">
					<image src="../../static/gongdi_menu.png" mode="widthFix"></image>
				</view>
				<view class="menu-item-title"><text>工地实景</text></view>
			</view>
			<view class="menu-item">
				<view class="menu-item-image">
					<image src="../../static/baojie_menu.png" mode="widthFix"></image>
				</view>
				<view class="menu-item-title"><text>保洁阿姨</text></view>
			</view>
		</view>
		<view>
			<view class="selection-content">
				<view class="header header-more">
					<view class="horizontal">
						<view class="line"></view>
						<view class="selection-header-title">热改楼盘</view>
					</view>
					<view class="horizontal" @click="openLouPanPage">
						<view class="more-text">更多</view>
						<view class="more-icon"></view>
					</view>
				</view>
				<view class="selection-content-list">
					<view class="selection-content-item" @click="openLoupanDetails" v-for="item in buildList">
						<view class="selection-content-item-image">
							<image :src="item.thumb" mode="scaleToFill"></image>
						</view>
						<view class="selection-content-item-mark">
							<view class="selection-content-item-mark-title">{{item.name}}</view>
							<view class="selection-content-item-mark-content">{{item.model.name}}/{{item.style.name}}</view>
						</view>
					</view>
				</view>
			</view>

			<view class="selection-content">
				<view class="header header-more">
					<view class="horizontal" @click="openLinBaoPage">
						<view class="line"></view>
						<view class="selection-header-title">拎包入住</view>
					</view>
					<view class="horizontal" @click="openLinBaoPage">
						<view class="more-text">更多</view>
						<view class="more-icon"></view>
					</view>
				</view>
				<view class="selection-content-list">
					<view class="selection-content-item" v-for="item in comboList">
						<view class="selection-content-item-image">
							<image :src="item.thumb" mode="scaleToFill"></image>
						</view>
						<view class="selection-content-item-mark">
							<view class="selection-content-item-mark-title">{{item.name}}</view>
							<view class="selection-content-item-mark-content">{{item.desc_str}}</view>
						</view>
					</view>
				</view>
			</view>

			<view class="selection-content">
				<view class="header header-more">
					<view class="horizontal">
						<view class="line"></view>
						<view class="selection-header-title">工地实景</view>
					</view>
					<view class="horizontal" @click="openNone">
						<view class="more-text">更多</view>
						<view class="more-icon"></view>
					</view>
				</view>
				<view class="selection-content-list">
					<view class="selection-content-item" style="width: 520rpx;height: 312rpx;"
						@click="openGongdiDetails" v-for="item in constructionList">
						<view class="selection-content-item-image" style="width: 520rpx;height: 312rpx;">
							<image :src="item.thumb" mode="widthFix"></image>
						</view>
						<view class="selection-content-item-mark" style="width: 520rpx;">
							<view class="selection-content-item-mark-title" style="text-align: center;">{{item.name}}</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
	</view>
	</view>

</template>

<script>
	export default {
		data() {
			return {
				bannerList: [],
				isShowDialog: true,
				isShowServeInfo: false,
				buildList:[],
				comboList:[],
				constructionList:[]
			};
		},
		methods: {
			openLouPanPage() {
				uni.navigateTo({
					url: '/pages/index/loupan/loupan'
				});
			},
			openGongdiPage() {
				uni.navigateTo({
					url: '/pages/index/gongdi/gongdi'
				});
			},
			openLinBaoPage() {
				uni.navigateTo({
					url: '/pages/index/linbao/linbao'
				});
			},
			openLoupanDetails() {
				uni.navigateTo({
					url: '/pages/index/loupan/details/details'
				})
			},
			openGongdiDetails() {
				uni.navigateTo({
					url: '/pages/index/gongdi/details/details'
				})
			},
			openNone() {
				uni.navigateTo({
					url: '/pages/index/gongdi/none'
				})
			},
			onLoad() {

				this.$http.post("/system/getBaseInfo", {}).then(res => {
					// console.log(res);
					this.bannerList = res.data.data.bannerList
				})
				this.$http.post("/system/getIndexData", {}).then(res => {
					this.buildList = res.data.data.buildList
					this.comboList = res.data.data.comboList
					this.constructionList = res.data.data.constructionList
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	page {
		background-color: #f5f5f5;
	}

	image {
		width: 100%;
	}

	::-webkit-scrollbar {
		display: none;
	}

	.content {
		width: 100%;
		height: 100%;

		.index_dialog {
			position: fixed;
			width: 100%;
			height: 100vh;
			background-color: rgba(0, 0, 0, 0.5);
			z-index: 999;
			display: flex;
			align-items: center;
			justify-content: center;
			flex-direction: column;

			.dialog_banner {
				width: 542rpx;
				height: 724rpx;
			}

			.dialog_close {
				margin-top: 86rpx;
				width: 80rpx;
				height: 80rpx;
			}
		}

		.serve {
			position: fixed;
			bottom: 132rpx;
			right: 20rpx;
			z-index: 999;

			.serve-image {
				width: 182rpx;
			}

			.serve-info {
				background: rgba(255, 255, 255, 0.8);
				border-radius: 12rpx;
				box-shadow: -4rpx 4rpx 4rpx 0rpx rgba(0, 0, 0, 0.15);
				padding-bottom: 40rpx;

				.header-more {
					padding: 20rpx;
				}

				.serve-info-title {
					margin-left: 20rpx;
				}

				.serve-info-close {
					width: 44rpx;
				}

				.serve-info-list {
					.serve-info-item {
						display: flex;
						padding: 0 46rpx;
						margin-top: 20rpx;

						.serve-info-item-image {
							width: 44rpx;
						}

						.serve-info-item-title {
							margin-left: 40rpx;
							font-size: 28rpx;
						}
					}
				}

				.serve-info-item:first-child {
					margin-top: 32rpx;
				}
			}
		}

		.menu-list {
			display: flex;
			padding: 40rpx 0;

			.menu-item {
				flex-basis: 25%;
				display: flex;
				flex-direction: column;
				align-items: center;
				justify-content: center;

				.menu-item-image {
					width: 80rpx;
				}

				.menu-item-title {
					font-size: 24rpx;
				}
			}
		}

		.selection-content {
			padding: 28rpx 40rpx 28rpx 40rpx;
			background-color: white;
			margin-top: 40rpx;

			.selection-header-title {
				font-size: 28rpx;
				margin-left: 20rpx;
			}

			.more-text {
				font-size: 24rpx;
			}

			.more-icon {
				margin-left: 10rpx;
				width: 8rpx;
				height: 8rpx;
				border-left: 2rpx solid #333;
				border-top: 2rpx solid #333;
				transform: rotate(135deg);
			}

			.selection-content-list {
				display: flex;
				overflow-x: scroll;
				overflow-y: hidden;

				.selection-content-item {
					position: relative;
					width: 382rpx;
					height: 510rpx;
					margin-top: 20rpx;
					margin-left: 40rpx;

					.selection-content-item-image {
						width: 382rpx;
						height: 510rpx;
					}

					.selection-content-item-image image {
						width: 100%;
						height: 100%;
						border-radius: 16rpx;
					}

					.selection-content-item-mark {
						box-sizing: border-box;
						position: absolute;
						background-color: rgba(0, 0, 0, 0.3);
						border-bottom-left-radius: 16rpx;
						border-bottom-right-radius: 16rpx;
						bottom: 0;
						width: 382rpx;
						padding: 12rpx 24rpx;
						line-height: 1.2em;

						.selection-content-item-mark-title {
							font-size: 24rpx;
							color: white;
						}

						.selection-content-item-mark-content {
							margin-top: 8rpx;
							font-size: 20rpx;
							color: rgba(255, 255, 255, 0.7);
						}
					}
				}

				.selection-content-item:first-child {
					margin-left: 0;
				}
			}
		}

		.selection-content:first-child {
			margin-top: 0;
		}
	}
</style>